//
//  MyItemView.swift
//  UNHimalayas
//
//  Created by 王水平 on 2019/11/21.
//  Copyright © 2019 HachiTech. All rights reserved.
//

import UIKit

class MyItemView: UIView {

    var imgView : UIImageView!
    var titleLabel : UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initImageView()
        initTitleLabel()
    }
    
    func initImageView() -> Void {
        
        imgView = UIImageView()
        imgView.backgroundColor = .red
        imgView.image = UIImage(named: "")
        self.addSubview(imgView)
        
        imgView.snp.makeConstraints { (make) in
            
            make.top.equalToSuperview()
            make.centerX.equalToSuperview()
            make.size.equalTo(kRealWidth(30))
        }
    }
    
    func initTitleLabel() -> Void {
        
        titleLabel = UILabel()
        titleLabel.backgroundColor = UIColor.clear
        titleLabel.text = "label"
        titleLabel.textColor = UIColor.black
        titleLabel.textAlignment = .left
        titleLabel.font = UIFont.systemFont(ofSize: kRealFont(13))
        self.addSubview(titleLabel)
        
        titleLabel.snp.makeConstraints { (make) in
            
            make.top.equalTo(imgView.snp.bottom).offset(kRealWidth(7))
            make.centerX.equalToSuperview()
            make.height.equalTo(kRealWidth(13))
            make.bottom.equalToSuperview()
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
